package cn.com.api.mapper.base;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import com.sdicons.json.validator.impl.predicates.True;

import cn.com.api.entity.ApiT_region;

//DAO
public interface T_regionMapperBase {

	// 根据id查看
	@Select("SELECT * FROM T_REGION  WHERE ID = #{id}")
	public ApiT_region findT_regionById(Integer id);

	// 查看数据集
	@Select("SELECT * FROM T_region")
	public List<ApiT_region> findT_regions();

	// 添加
	@Insert("INSERT INTO T_REGION (PARENT_ID, NAME, TYPE, CREATE_DATE) VALUES (#{parent_id}, #{name}, #{type}, #{create_date})")
	@Options(useGeneratedKeys = true, keyProperty = "id")
	public int insertT_region(ApiT_region t_region);

	// 修改
	@Update("UPDATE T_REGION SET PARENT_ID = #{parent_id}, NAME = #{name}, TYPE = #{type}, CREATE_DATE = #{create_date} WHERE ID = #{id}")
	public int updateT_region(ApiT_region t_region);

	// 删除
	@Delete("DELETE FROM T_REGION  WHERE ID = #{id}")
	public int deleteT_region(Integer id);

	// Foreign keys revelant

	// region Indexs revelant

}
